
Ext.define('passport.main.Main', {
  extend: 'Ext.container.Viewport',
    
    config: {
        companyName: '',
        pageSize: "0"
    },

    constructor: function(config) {
        this.callParent(arguments);
        this.initConfig(config);
    },

  	initComponent: function(){
        Ext.apply(this, {
            layout: 'border',
            padding: 0,
            items: 
            [
	            this.createNorthPanel(), 
	            this.createWestPanel(), 
	            this.createMainPanel(), 
	            this.createEastPanel(), 
	            this.createSouthPanel()
	          ]
        });
        this.callParent(arguments);
    },
    
		createNorthPanel: function(){
	        this.northPanel = Ext.create('passport.main.NorthPanel', {
	            region: 'north',
	            collapsible: false,
	            width: 225,
	            floatable: true,
	            split: false,
	            minWidth: 175,
                companyName: this.companyName
	        });
	        
	        return this.northPanel;
	  },
	  
	  createMainPanel: function(){
	        this.mainPanel = Ext.create('passport.main.MainPanel', {
	            region: 'center',
				minWidth: 300
			});
	        return this.mainPanel;
	  },
	  
	  createWestPanel: function(){
	        this.westPanel = Ext.create('passport.main.WestPanel', {
	            region: 'west',
	            collapsible: true,
	            width: 225,
	            floatable: false,
	            split: true,
	            minWidth: 175
	        });
	        return this.westPanel;
	  },
	  createEastPanel: function(){
	        this.eastPanel = Ext.create('passport.main.EastPanel', {
	            region: 'east',
	            collapsible: true,
	            width: 225,
	            floatable: false,
	            split: true,
	            minWidth: 175
	        });
	        return this.eastPanel;
	  },
	  createSouthPanel: function(){
	        this.southPanel = Ext.create('passport.main.SouthPanel', {
	            region: 'south',
	            floatable: false
	        });
	        return this.southPanel;
	  }
});